import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
// export default new Vuex.Store({
// 	state: {
// 		unreadCount: 0
// 	},
// 	mutations: {
// 		setUnreadCount(state, count) {
// 			state.unreadCount = count
// 		},
// 		clearUnreadCount(state) {
// 			state.unreadCount = 0
// 			uni.setStorageSync('messageUnread', 0)
// 		}
// 	}
// })
const files = require.context("./modules", false, /\.js$/);
let modules = {
	state: {},
	mutations: {},
	actions: {}
};
files.keys().forEach((key) => {
	Object.assign(modules.state, files(key)["state"]);
	Object.assign(modules.mutations, files(key)["mutations"]);
	Object.assign(modules.actions, files(key)["actions"]);
});
const store = new Vuex.Store(modules);
export default store;